package com.hkts.reportform.basedao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Repository
public class BaseDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public List<Map<String,Object>> queryForList(String sql){

        return jdbcTemplate.queryForList(sql);
    }

    public List<Map<String,Object>> queryForListByParames(String sql,Map<String,Object> map){
       List<String> list=new ArrayList<String>();
        list.add("2011-04-13 21:18:13");
        list.add("2012-11-02 19:28:34");
        return jdbcTemplate.queryForList(sql,list);
    }
}
